﻿using UnityEngine;
using System.Collections;
using FairyGUI;
using System;

/// <summary>
/// 用户头像
/// </summary>
public class UIHeadpicImage {

    GImage _headpicImg;

    public UIHeadpicImage(GComponent comp, Action callback = null)
    {
        _headpicImg = comp.GetChild("头像").asImage;
        GButton headpicBtn = comp.GetChild("头像按钮").asButton;
        headpicBtn.onClick.Add(()=> {
            if (callback != null)
            {
                callback();
            }
        });
    }

    /// <summary>
    /// 设置头像
    /// </summary>
    /// <param name="headpicUrl"></param>
    public void SetHeadpic(string headpicUrl)
    {
        // TODO
        DebugInfo.Warning("实现设置头像");
    }
}
